#!/bin/sh

start_test()
{
	#Start CAN Test
	caninit=$(ifconfig | grep "can0")                       
	if [[ -z $caninit ]]; then                              
        	echo "init CAN"                                 
        	ip link set can0 type can bitrate 1000000     
        	ip link set can0 txqueuelen 1000     
        	ip link set up can0                   
	fi
        
	# For full image                                              
	#cansend can0 0ff#11223344AABBCCDD
	# For minimal image 
	cansend can0 0x11 0x22 0x33 0x44 0xaa 0xbb 0xcc 0xdd                                                           
}


case $# in
        0)
		start_test 
                ;;
        *)
                echo "Usage: $0"
                #exit 1
                ;;
esac
